package com.hifar.test.structure.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hifar.test.structure.mapper.HfEnvResPersonWorkRecordMapper;
import com.hifar.test.structure.pojo.HfEnvResPersonWorkRecord;
import com.hifar.test.structure.service.IHfEnvResPersonWorkRecordService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Service
public class HfEnvResPersonWorkRecordServiceImpl extends ServiceImpl<HfEnvResPersonWorkRecordMapper, HfEnvResPersonWorkRecord>
        implements IHfEnvResPersonWorkRecordService {
    @Override
    public List<HfEnvResPersonWorkRecord> listByPersonId(String personId) {
        QueryWrapper<HfEnvResPersonWorkRecord> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda()
                .eq(HfEnvResPersonWorkRecord::getPersonId, personId)
                .orderByAsc(HfEnvResPersonWorkRecord::getRowSort);
        return this.list(queryWrapper);
    }

    @Override
    public void removeByPersonId(String personId) {
        QueryWrapper<HfEnvResPersonWorkRecord> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda()
                .eq(HfEnvResPersonWorkRecord::getPersonId, personId)
                .orderByAsc(HfEnvResPersonWorkRecord::getRowSort);
        this.remove(queryWrapper);
    }
}




